Repository navigation
test(oauth2): auto-sync oidc-jwt-1 provider JWKs on SA key rotation - #14914
Open
macastelaz wants to merge 3 commits into
Open
macastelaz wants to merge 3 commits into
macastelaz wants to merge 3 commits into
Conversation
…event key-rotation breakage
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the workload identity federation integration tests to use a static test private key instead of the service account's private key. It modifies the setup script to append this static key to the JWK set retrieved from Google. The review feedback suggests improving the inline Python script in the setup script by adding a timeout and using a context manager for the network request to prevent potential hangs in CI/CD pipelines.
macastelaz
marked this pull request as ready for review
November 16, 2026 18:36
jinseopkim0
approved these changes
Nov 16, 2026
macastelaz
enabled auto-merge (squash)
November 16, 2026 18:48
macastelaz
disabled auto-merge
November 16, 2026 18:51
lqiu96
reviewed
Nov 16, 2026
|
|
||
| private String generateSignedOidcJwt(String audience, String x5tS256, boolean includeMayAct) | ||
| throws IOException { | ||
| ensureOidcJwtProviderJwksSynced(); |
Member
There was a problem hiding this comment.
qq, should we call this in something like a @BeforeAll or something? Also if this call fails, should we just fail the rest of the tests in this file?
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automatically syncs the
oidc-jwt-1Workload Identity Pool Provider's staticjwksJsoninITWorkloadIdentityFederationTestwhenever the integration test service account (it-service-account@gcloud-devel.iam.gserviceaccount.com) rotates keys bi-monthly (java_it_service_account_rotation).Background
actor_tokenWorkload Identity Federation tests added in feat(oauth2): support certificate-bound OAuth2 tokens and mTLS rotation for Workload Identity Federation #14781 sign mock OIDC JWTs withit-service-account@gcloud-devel.iam.gserviceaccount.com's private key (GOOGLE_APPLICATION_CREDENTIALS), verified against theoidc-jwt-1OIDC provider ingcloud-devel.it-service-accountrotates keys every two months, the newprivate_key_id(kid) is not inoidc-jwt-1's staticjwksJson, causing STS token exchange to fail with400 Bad Request: Invalid JWT signature.ITWorkloadIdentityFederationTestruns authenticated asit-service-account@gcloud-devel.iam.gserviceaccount.com—which already holdsroles/iam.workloadIdentityPoolAdminongcloud-devel—ensureOidcJwtProviderJwksSynced()checks once per test run whetheroidc-jwt-1'sjwksJsonincludesprivateKeyId. On the first run after a key rotation, it fetches the service account's live public JWK set (https://www.googleapis.com/service_accounts/v1/jwk/<client_email>) and patchesoidc-jwt-1.See https://docs.google.com/document/d/1cjtmXb4tGZgyvTgL2hfn96KaNnAukdt6FJ8j4CV2H_k/view for more details